﻿using System;
using System.Net;
using SCG.SolarVengeanceEngine;

namespace SCG.SolarVengeance.Scenarios
{
    //Classic Scenario
    public class Classic : Scenario
    {
        //constructor, create instances of the parameter objects
        public Classic()
        {
            paramStarSystems = CreateParameter("Star Systems", 24, 10, 40);
            paramDensity = CreateParameter("Cluster Density", 2, 1, 10);
        }

        //Scenario Description
        public override string Description
        {
            get
            {
                return "After the fall of the Stellar Empire, the most powerful Star Lords gathered their forces at their Capital StarSystems. " +
                    "The Cluster was ripe for conquest, and it was time for each Star Lord to establish their territory in this new age.";
            }
        }

        //Build the scenario, single cluster
        public override void BuildScenario(int numPlayers, int capitalValues, int startingResources)
        {
            CreateStarCluster(paramStarSystems.Value, 50, 50, 50, 50, 35, paramDensity.Value);
            int numNebula = SVGame.RNG.Next(4) + 2;
            while (numNebula > 0)
            {
                CreateNebula(SVGame.RNG.Next(40) + 30, SVGame.RNG.Next(40) + 30, SVGame.RNG.Next(5) + 4, SVGame.RNG.Next(40) + 30);
                numNebula--;
            }
            int numWormholes = SVGame.RNG.Next(4) + 1;
            while (numWormholes > 0)
            {
                CreateWormhole(SVGame.RNG.Next(100), SVGame.RNG.Next(100), SVGame.RNG.Next(40) + 30, SVGame.RNG.Next(40) + 30);
                numWormholes--;
            }
            numWormholes = SVGame.RNG.Next(4) + 1;
            while (numWormholes > 0)
            {
                CreateWormhole(SVGame.RNG.Next(40) + 30, SVGame.RNG.Next(40) + 30, SVGame.RNG.Next(100), SVGame.RNG.Next(100));
                numWormholes--;
            }           
        }

        //Define parameters that can be modified by the setup page
        private ScenarioParameter paramStarSystems;
        private ScenarioParameter paramDensity;
    }
}
